 <?php use_helper('I18N', 'Date') ?> 

  <?php include_partial('incident/flashes') ?>
  <div id="sf_admin_header">
    <?php include_partial('incident/form_header', array('ml_incidents' => $ml_incidents, 'form' => $form, 'configuration' => $configuration)) ?>
  </div>

  <div id="sf_admin_content">
<h1 class="etiquette">Nouvel incident <?php echo $ml_incidents->getMachineStringFull() ?></h1>
    <?php include_partial('incident/form', array('ml_incidents' => $ml_incidents, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?>
    <script type="text/javascript">
    $(document).ready(function(){
    	$('.sf_admin_form form').submit(function(event){
    		if($('#ml_incidents_intervention').val().length < 3){
    			alert('Vous devez saisir une intervention !');
    			event.preventDefault();
    		}
    	});
        $('.sf_admin_form_field_sfm_do').detach().appendTo('.sf_admin_form_field_sfm');
        $('.sf_admin_form_field_controler_do').detach().appendTo('.sf_admin_form_field_controler');
    });
    </script>
  </div>
  <h1 class="etiquette">Historique pannes</h1>
  <div class="historique" style="clear:both;">
    <?php include_partial('incident/historique', array('pager' => $pager, 'sort' => $sort, 'helper' => $helper)) ?>
	</div>
  <div id="sf_admin_footer">
    <?php include_partial('incident/form_footer', array('ml_incidents' => $ml_incidents, 'form' => $form, 'configuration' => $configuration)) ?>
  </div>
<?php
if($form->isNew()):
?>
<script type="text/javascript">
$(document).ready(function(){
	$('#ml_incidents_updated_at_day').val('<?php echo date('j'); ?>');
	$('#ml_incidents_updated_at_month').val('<?php echo date('n'); ?>');
	$('#ml_incidents_updated_at_year').val('<?php echo date('Y'); ?>');
	$('#ml_incidents_updated_at_hour').val('<?php echo date('G'); ?>');
	$('#ml_incidents_updated_at_minute').val('<?php echo (int)date('i'); ?>');
});
</script>
<?php
endif;
?>

<script type="text/javascript">
jQuery(document).ready(function(){ datepickersico(); });
</script>